///*
// * To change this template, choose Tools | Templates
// * and open the template in the editor.
// */
//package company.search.beans;
//
//import facades.CandidateFacade;
//import facades.CompanyFacade;
//import facades.CompanyFolderFacade;
//import facades.SearchEducationalInfoRequerimentAndOperatorFacade;
//import facades.SearchEducationalInfoRequerimentOrOperatorFacade;
//import facades.SearchFacade;
//import facades.SearchInterestAreaRequerimentAndOperatorFacade;
//import facades.SearchInterestAreaRequerimentOrOperatorFacade;
//import facades.SearchLanguageInfoRequerimentAndOperatorFacade;
//import facades.SearchLanguageInfoRequerimentOrOperatorFacade;
//import facades.SearchProfessionalInfoRequerimentAndOperatorFacade;
//import facades.SearchProfessionalInfoRequerimentOrOperatorFacade;
//import facades.SearchRelocatingInfoRequerimentAndOperatorFacade;
//import facades.SearchRelocatingInfoRequerimentOrOperatorFacade;
//import entities.Candidate;
//import entities.Company;
//import entities.CompanyFolder;
//import entities.Search;
//import entities.SearchEducationalInfoRequerimentAndOperator;
//import entities.SearchEducationalInfoRequerimentOrOperator;
//import entities.SearchInterestAreaRequerimentAndOperator;
//import entities.SearchInterestAreaRequerimentOrOperator;
//import entities.SearchLanguageInfoRequerimentAndOperator;
//import entities.SearchLanguageInfoRequerimentOrOperator;
//import entities.SearchProfessionalInfoRequerimentAndOperator;
//import entities.SearchProfessionalInfoRequerimentOrOperator;
//import entities.SearchRelocatingInfoRequerimentAndOperator;
//import entities.SearchRelocatingInfoRequerimentOrOperator;
//import facades.CompanyFolderTypeFacade;
//import javax.inject.Named;
//import java.io.Serializable;
//import java.util.ArrayList;
//import java.util.Date;
//import java.util.List;
//import java.util.Locale;
//import java.util.ResourceBundle;
//import javax.annotation.PostConstruct;
//import javax.enterprise.context.SessionScoped;
//import javax.enterprise.event.Event;
//import javax.enterprise.event.Observes;
//import javax.faces.context.FacesContext;
//import javax.inject.Inject;
//import javax.servlet.http.HttpServletRequest;
//import qualifiers.CreatedEntityEvent;
//import qualifiers.LoggedIn;
//import qualifiers.PreCreateEntityEvent;
//import sqlgenerators.createsearch.CreateSearchBeanSQLGeneratorInterface;
//import sqlgenerators.createsearch.CreateSearchSQLGenerator;
//
///**
// *
// * @author damfercer
// */
//@Named
//@SessionScoped
//public class CreateSearchBean implements Serializable {
//    @Inject
//    CompanyFacade companyEJB;
//    @Inject
//    SearchFacade searchEJB;
//    @Inject
//    CandidateFacade candidateEJB;
//    @Inject
//    CompanyFolderFacade companyFolderEJB;
//    @Inject
//    SearchEducationalInfoRequerimentAndOperatorFacade educationalAndEJB;
//    @Inject
//    SearchEducationalInfoRequerimentOrOperatorFacade educationalOrEJB;
//    @Inject
//    SearchProfessionalInfoRequerimentAndOperatorFacade professionalAndEJB;
//    @Inject
//    SearchProfessionalInfoRequerimentOrOperatorFacade professionalOrEJB;
//    @Inject
//    SearchLanguageInfoRequerimentAndOperatorFacade languageAndEJB;
//    @Inject
//    SearchLanguageInfoRequerimentOrOperatorFacade languageOrEJB;
//    @Inject
//    SearchRelocatingInfoRequerimentAndOperatorFacade relocatingAndEJB;
//    @Inject
//    SearchRelocatingInfoRequerimentOrOperatorFacade relocatingOrEJB;
//    @Inject
//    SearchInterestAreaRequerimentAndOperatorFacade interestAndEJB;
//    @Inject
//    SearchInterestAreaRequerimentOrOperatorFacade interestOrEJB;
//    @Inject
//    @LoggedIn
//    private Company company;
//    private List<Candidate> previewCandidates;
//    private CreateSearchBeanSQLGeneratorInterface searchSQLGenerator;
//    private Search search;
//    private Integer numberOfCandidates;
//    @Inject
//    @CreatedEntityEvent
//    private Event<Search> newSearchEvent;
//    @Inject
//    private CompanyFolderTypeFacade companyFolderTypeFacade;
//    
//    //Advanced search
//    private SearchEducationalInfoRequerimentAndOperator educationalAndCollector;
//    private SearchEducationalInfoRequerimentOrOperator educationalOrCollector;
//    private SearchInterestAreaRequerimentAndOperator interestAreaAndCollector;
//    private SearchInterestAreaRequerimentOrOperator interestAreaOrCollector;
//    private SearchLanguageInfoRequerimentAndOperator languageAndCollector;
//    private SearchLanguageInfoRequerimentOrOperator languageOrCollector;
//    private SearchProfessionalInfoRequerimentAndOperator professionalAndCollector;
//    private SearchProfessionalInfoRequerimentOrOperator professionalOrCollector;
//    private SearchRelocatingInfoRequerimentAndOperator relocatingAndCollector;
//    private SearchRelocatingInfoRequerimentOrOperator relocatingOrCollector;
//    
//    /**
//     * Creates a new instance of CreateSearchBean
//     */
//    public CreateSearchBean() {
//        
//    }
//    
//    @PostConstruct
//    public void fillCreateSearchBean(){
//        search=new Search();
//        search.setSearchEducationalInfoRequerimentAndOperatorList(new ArrayList<SearchEducationalInfoRequerimentAndOperator>());
//        search.setSearchEducationalInfoRequerimentOrOperatorList(new ArrayList<SearchEducationalInfoRequerimentOrOperator>());
//        search.setSearchInterestAreaRequerimentAndOperatorList(new ArrayList<SearchInterestAreaRequerimentAndOperator>());
//        search.setSearchInterestAreaRequerimentOrOperatorList(new ArrayList<SearchInterestAreaRequerimentOrOperator>());
//        search.setSearchLanguageInfoRequerimentAndOperatorList(new ArrayList<SearchLanguageInfoRequerimentAndOperator>());
//        search.setSearchLanguageInfoRequerimentOrOperatorList(new ArrayList<SearchLanguageInfoRequerimentOrOperator>());
//        search.setSearchProfessionalInfoRequerimentAndOperatorList(new ArrayList<SearchProfessionalInfoRequerimentAndOperator>());
//        search.setSearchProfessionalInfoRequerimentOrOperatorList(new ArrayList<SearchProfessionalInfoRequerimentOrOperator>());
//        search.setSearchRelocatingInfoRequerimentAndOperatorList(new ArrayList<SearchRelocatingInfoRequerimentAndOperator>());
//        search.setSearchRelocatingInfoRequerimentOrOperatorList(new ArrayList<SearchRelocatingInfoRequerimentOrOperator>());
//        educationalAndCollector=new SearchEducationalInfoRequerimentAndOperator();
//        educationalOrCollector=new SearchEducationalInfoRequerimentOrOperator();
//        interestAreaAndCollector=new SearchInterestAreaRequerimentAndOperator();
//        interestAreaOrCollector=new SearchInterestAreaRequerimentOrOperator();
//        languageAndCollector=new SearchLanguageInfoRequerimentAndOperator();
//        languageOrCollector=new SearchLanguageInfoRequerimentOrOperator();
//        professionalAndCollector=new SearchProfessionalInfoRequerimentAndOperator();
//        professionalOrCollector=new SearchProfessionalInfoRequerimentOrOperator();
//        relocatingAndCollector=new SearchRelocatingInfoRequerimentAndOperator();
//        relocatingOrCollector=new SearchRelocatingInfoRequerimentOrOperator();
//        searchSQLGenerator=new CreateSearchSQLGenerator();
//        //updateNumberOfValidCandidates();
//    }
//    
//    public void onPreNewSearchEvent(@Observes @PreCreateEntityEvent Integer i){
//        fillCreateSearchBean();
//    }
//    
//    //TODO: Carne de refactorización, hay acoplamiento directo, prioridad=media
//    public void updateNumberOfValidCandidates(){
//        String sql=searchSQLGenerator.getSqlFromCreateSearchBean(this);
//        numberOfCandidates=candidateEJB.getNumberOfValidCandidates(sql,company);
//        previewCandidates=candidateEJB.getPreviewNewSearchCandidates(sql, company);
//    }
//    
//    public void removeFromLanguageOrList(SearchLanguageInfoRequerimentOrOperator item){
//        search.getSearchLanguageInfoRequerimentOrOperatorList().remove(item);
//        updateNumberOfValidCandidates();
//    }
//    public void removeFromLanguageAndList(SearchLanguageInfoRequerimentAndOperator item){
//        search.getSearchLanguageInfoRequerimentAndOperatorList().remove(item);
//        updateNumberOfValidCandidates();
//    }
//    public void removeFromEducationalOrList(SearchEducationalInfoRequerimentOrOperator item){
//        search.getSearchEducationalInfoRequerimentOrOperatorList().remove(item);
//        updateNumberOfValidCandidates();
//    }
//    public void removeFromEducationalAndList(SearchEducationalInfoRequerimentAndOperator item){
//        search.getSearchEducationalInfoRequerimentAndOperatorList().remove(item);
//        updateNumberOfValidCandidates();
//    }
//    public void removeFromProfessionalOrList(SearchProfessionalInfoRequerimentOrOperator item){
//        search.getSearchProfessionalInfoRequerimentOrOperatorList().remove(item);
//        updateNumberOfValidCandidates();
//    }
//    public void removeFromProfessionalAndList(SearchProfessionalInfoRequerimentAndOperator item){
//        search.getSearchProfessionalInfoRequerimentAndOperatorList().remove(item);        
//        updateNumberOfValidCandidates();
//    }
//    public void removeFromRelocatingOrList(SearchRelocatingInfoRequerimentOrOperator item){
//        search.getSearchRelocatingInfoRequerimentOrOperatorList().remove(item);
//        updateNumberOfValidCandidates();
//    }
//    public void removeFromRelocatingAndList(SearchRelocatingInfoRequerimentAndOperator item){
//        search.getSearchRelocatingInfoRequerimentAndOperatorList().remove(item);
//        updateNumberOfValidCandidates();
//    }
//    public void removeFromInterestOrList(SearchInterestAreaRequerimentOrOperator item){
//        search.getSearchInterestAreaRequerimentOrOperatorList().remove(item);
//        updateNumberOfValidCandidates();
//    }
//    public void removeFromInterestAndList(SearchInterestAreaRequerimentAndOperator item){
//        search.getSearchInterestAreaRequerimentAndOperatorList().remove(item);
//        updateNumberOfValidCandidates();
//    }
//    
//    private CompanyFolder createFolder(){
//            CompanyFolder folder=new CompanyFolder();
//            folder.setIdCompany(getCompany());
//            folder.setDescription(search.getDescription());
//            folder.setCreationDate(new Date());
//            folder.setCompanyFolderType(companyFolderTypeFacade.getNormalFolderType());
//            companyFolderEJB.create(folder);
//            if(getCompany().getCompanyFolderList()==null){
//                getCompany().setCompanyFolderList(new ArrayList<CompanyFolder>());
//            };
//            getCompany().getCompanyFolderList().add(folder);
//            search.setFolder(folder);
//            return folder;
//    }
//    
//    public String createSearch(){
//        CompanyFolder folder=search.getFolder();
//        if(folder==null){
//            folder=createFolder();
//        }
//        search.setIsPublic(Boolean.FALSE);
//        search.setActive(true);
//        search.setCreateDate(new Date());
//        search.setLastSearchDate(new Date());
//        search.setCompany(getCompany());
//        createAdvancedParametersAndPersist();
//        if(folder.getSearchList()==null){
//            folder.setSearchList(new ArrayList<Search>());
//        }
//        folder.getSearchList().add(search);
//        if(getCompany().getSearchList()==null){
//            getCompany().setSearchList(new ArrayList<Search>());
//        }
//        getCompany().getSearchList().add(search);
//        searchEJB.evict(search,search.getIdSearch());
//        companyEJB.evict(getCompany(),getCompany().getIdCompany());
//        companyFolderEJB.evict(folder,folder.getIdCompanyFolder());
//        newSearchEvent.fire(search);
//        return "/views/company/search/ViewSearchView?faces-redirect=true";
//    }
//    
//    private void createAdvancedParametersAndPersist(){
//        List<SearchEducationalInfoRequerimentAndOperator> educationalAnd=search.getSearchEducationalInfoRequerimentAndOperatorList();
//        List<SearchEducationalInfoRequerimentOrOperator> educationalOr=search.getSearchEducationalInfoRequerimentOrOperatorList();
//        List<SearchInterestAreaRequerimentAndOperator> interestAnd=search.getSearchInterestAreaRequerimentAndOperatorList();
//        List<SearchInterestAreaRequerimentOrOperator> interestOr=search.getSearchInterestAreaRequerimentOrOperatorList();
//        List<SearchLanguageInfoRequerimentAndOperator> languageAnd=search.getSearchLanguageInfoRequerimentAndOperatorList();
//        List<SearchLanguageInfoRequerimentOrOperator> languageOr=search.getSearchLanguageInfoRequerimentOrOperatorList();
//        List<SearchProfessionalInfoRequerimentAndOperator> professionalAnd=search.getSearchProfessionalInfoRequerimentAndOperatorList(); 
//        List<SearchProfessionalInfoRequerimentOrOperator> professionalOr=search.getSearchProfessionalInfoRequerimentOrOperatorList();
//        List<SearchRelocatingInfoRequerimentAndOperator> relocatingAnd=search.getSearchRelocatingInfoRequerimentAndOperatorList();
//        List<SearchRelocatingInfoRequerimentOrOperator> relocatingOr=search.getSearchRelocatingInfoRequerimentOrOperatorList();
//        search.setSearchEducationalInfoRequerimentAndOperatorList(null);
//        search.setSearchEducationalInfoRequerimentOrOperatorList(null);
//        search.setSearchInterestAreaRequerimentAndOperatorList(null);
//        search.setSearchInterestAreaRequerimentOrOperatorList(null);
//        search.setSearchLanguageInfoRequerimentAndOperatorList(null);
//        search.setSearchLanguageInfoRequerimentOrOperatorList(null);
//        search.setSearchProfessionalInfoRequerimentAndOperatorList(null);
//        search.setSearchProfessionalInfoRequerimentOrOperatorList(null);
//        search.setSearchRelocatingInfoRequerimentAndOperatorList(null);
//        search.setSearchRelocatingInfoRequerimentOrOperatorList(null);
//        searchEJB.create(search);
//        search.setSearchEducationalInfoRequerimentAndOperatorList(educationalAnd);
//        search.setSearchEducationalInfoRequerimentOrOperatorList(educationalOr);
//        search.setSearchInterestAreaRequerimentAndOperatorList(interestAnd);
//        search.setSearchInterestAreaRequerimentOrOperatorList(interestOr);
//        search.setSearchLanguageInfoRequerimentAndOperatorList(languageAnd);
//        search.setSearchLanguageInfoRequerimentOrOperatorList(languageOr);
//        search.setSearchProfessionalInfoRequerimentAndOperatorList(professionalAnd);
//        search.setSearchProfessionalInfoRequerimentOrOperatorList(professionalOr);
//        search.setSearchRelocatingInfoRequerimentAndOperatorList(relocatingAnd);
//        search.setSearchRelocatingInfoRequerimentOrOperatorList(relocatingOr);
//        for(SearchEducationalInfoRequerimentAndOperator edA:educationalAnd){
//            edA.setSearch(search);
//            educationalAndEJB.create(edA);
//        }
//        for(SearchEducationalInfoRequerimentOrOperator edO:search.getSearchEducationalInfoRequerimentOrOperatorList()){
//            edO.setSearch(search);
//            educationalOrEJB.create(edO);
//        }
//        for(SearchInterestAreaRequerimentAndOperator intA:search.getSearchInterestAreaRequerimentAndOperatorList()){
//            intA.setSearch(search);
//            interestAndEJB.create(intA);
//        }
//        for(SearchInterestAreaRequerimentOrOperator intO:search.getSearchInterestAreaRequerimentOrOperatorList()){
//            intO.setSearch(search);
//            interestOrEJB.create(intO);
//        }
//        for(SearchLanguageInfoRequerimentAndOperator lanA:search.getSearchLanguageInfoRequerimentAndOperatorList()){
//            lanA.setSearch(search);
//            languageAndEJB.create(lanA);
//        }
//        for(SearchLanguageInfoRequerimentOrOperator lanO:search.getSearchLanguageInfoRequerimentOrOperatorList()){
//            lanO.setSearch(search);
//            languageOrEJB.create(lanO);
//        }
//        for(SearchProfessionalInfoRequerimentAndOperator proA:search.getSearchProfessionalInfoRequerimentAndOperatorList()){
//            proA.setSearch(search);
//            professionalAndEJB.create(proA);
//        }
//        for(SearchProfessionalInfoRequerimentOrOperator proO:search.getSearchProfessionalInfoRequerimentOrOperatorList()){
//            proO.setSearch(search);
//            professionalOrEJB.create(proO);
//        }
//        for(SearchRelocatingInfoRequerimentAndOperator relA:search.getSearchRelocatingInfoRequerimentAndOperatorList()){
//            relA.setSearch(search);
//            relocatingAndEJB.create(relA);
//        }
//        for(SearchRelocatingInfoRequerimentOrOperator relO:search.getSearchRelocatingInfoRequerimentOrOperatorList()){
//            relO.setSearch(search);
//            relocatingOrEJB.create(relO);
//        }
//        
//    }
//    
//    public void addSearchEducationalInfoRequerimentAndOperator(){
//        search.getSearchEducationalInfoRequerimentAndOperatorList().add(educationalAndCollector);
//        educationalAndCollector=new SearchEducationalInfoRequerimentAndOperator();
//        updateNumberOfValidCandidates();
//    }
//    public void addSearchEducationalInfoRequerimentOrOperator(){
//        search.getSearchEducationalInfoRequerimentOrOperatorList().add(educationalOrCollector);
//        educationalOrCollector=new SearchEducationalInfoRequerimentOrOperator();
//        updateNumberOfValidCandidates();
//    }
//    public void addSearchInterestAreaRequerimentAndOperator(){
//        search.getSearchInterestAreaRequerimentAndOperatorList().add(interestAreaAndCollector);
//        interestAreaAndCollector=new SearchInterestAreaRequerimentAndOperator();
//        updateNumberOfValidCandidates();
//    }
//    public void addSearchInterestAreaRequerimentOrOperator(){
//        search.getSearchInterestAreaRequerimentOrOperatorList().add(interestAreaOrCollector);
//        interestAreaOrCollector=new SearchInterestAreaRequerimentOrOperator();
//        updateNumberOfValidCandidates();
//    }
//    public void addSearchLanguageInfoRequerimentAndOperator(){
//        search.getSearchLanguageInfoRequerimentAndOperatorList().add(languageAndCollector);
//        languageAndCollector=new SearchLanguageInfoRequerimentAndOperator();
//        updateNumberOfValidCandidates();
//    }
//    public void addSearchLanguageInfoRequerimentOrOperator(){
//        search.getSearchLanguageInfoRequerimentOrOperatorList().add(languageOrCollector);
//        languageOrCollector=new SearchLanguageInfoRequerimentOrOperator();
//        updateNumberOfValidCandidates();
//    }
//    public void addSearchProfessionalInfoRequerimentAndOperator(){
//        search.getSearchProfessionalInfoRequerimentAndOperatorList().add(professionalAndCollector);
//        professionalAndCollector=new SearchProfessionalInfoRequerimentAndOperator();
//        updateNumberOfValidCandidates();
//    }
//    public void addSearchProfessionalInfoRequerimentOrOperator(){
//        search.getSearchProfessionalInfoRequerimentOrOperatorList().add(professionalOrCollector);
//        professionalOrCollector=new SearchProfessionalInfoRequerimentOrOperator();
//        updateNumberOfValidCandidates();
//    }
//    public void addSearchRelocatingInfoRequerimentAndOperator(){
//        search.getSearchRelocatingInfoRequerimentAndOperatorList().add(relocatingAndCollector);
//        relocatingAndCollector=new SearchRelocatingInfoRequerimentAndOperator();
//        updateNumberOfValidCandidates();
//    }
//    public void addSearchRelocatingInfoRequerimentOrOperator(){
//        search.getSearchRelocatingInfoRequerimentOrOperatorList().add(relocatingOrCollector);
//        relocatingOrCollector=new SearchRelocatingInfoRequerimentOrOperator();
//        updateNumberOfValidCandidates();
//    }
//    
//    /**
//     * @return the search
//     */
//    public Search getSearch() {
//        return search;
//    }
//
//    /**
//     * @param search the search to set
//     */
//    public void setSearch(Search search) {
//        this.search = search;
//    }
//
//    /**
//     * @return the numberOfCandidates
//     */
//    public Integer getNumberOfCandidates() {
//        return numberOfCandidates;
//    }
//
//    /**
//     * @param numberOfCandidates the numberOfCandidates to set
//     */
//    public void setNumberOfCandidates(Integer numberOfCandidates) {
//        this.numberOfCandidates = numberOfCandidates;
//    }
//
//    /**
//     * @return the educationalAndCollector
//     */
//    public SearchEducationalInfoRequerimentAndOperator getEducationalAndCollector() {
//        return educationalAndCollector;
//    }
//
//    /**
//     * @param educationalAndCollector the educationalAndCollector to set
//     */
//    public void setEducationalAndCollector(SearchEducationalInfoRequerimentAndOperator educationalAndCollector) {
//        this.educationalAndCollector = educationalAndCollector;
//    }
//
//    /**
//     * @return the educationalOrCollector
//     */
//    public SearchEducationalInfoRequerimentOrOperator getEducationalOrCollector() {
//        return educationalOrCollector;
//    }
//
//    /**
//     * @param educationalOrCollector the educationalOrCollector to set
//     */
//    public void setEducationalOrCollector(SearchEducationalInfoRequerimentOrOperator educationalOrCollector) {
//        this.educationalOrCollector = educationalOrCollector;
//    }
//
//    /**
//     * @return the interestAreaAndCollector
//     */
//    public SearchInterestAreaRequerimentAndOperator getInterestAreaAndCollector() {
//        return interestAreaAndCollector;
//    }
//
//    /**
//     * @param interestAreaAndCollector the interestAreaAndCollector to set
//     */
//    public void setInterestAreaAndCollector(SearchInterestAreaRequerimentAndOperator interestAreaAndCollector) {
//        this.interestAreaAndCollector = interestAreaAndCollector;
//    }
//
//    /**
//     * @return the interestAreaOrCollector
//     */
//    public SearchInterestAreaRequerimentOrOperator getInterestAreaOrCollector() {
//        return interestAreaOrCollector;
//    }
//
//    /**
//     * @param interestAreaOrCollector the interestAreaOrCollector to set
//     */
//    public void setInterestAreaOrCollector(SearchInterestAreaRequerimentOrOperator interestAreaOrCollector) {
//        this.interestAreaOrCollector = interestAreaOrCollector;
//    }
//
//    /**
//     * @return the languageAndCollector
//     */
//    public SearchLanguageInfoRequerimentAndOperator getLanguageAndCollector() {
//        return languageAndCollector;
//    }
//
//    /**
//     * @param languageAndCollector the languageAndCollector to set
//     */
//    public void setLanguageAndCollector(SearchLanguageInfoRequerimentAndOperator languageAndCollector) {
//        this.languageAndCollector = languageAndCollector;
//    }
//
//    /**
//     * @return the languageOrCollector
//     */
//    public SearchLanguageInfoRequerimentOrOperator getLanguageOrCollector() {
//        return languageOrCollector;
//    }
//
//    /**
//     * @param languageOrCollector the languageOrCollector to set
//     */
//    public void setLanguageOrCollector(SearchLanguageInfoRequerimentOrOperator languageOrCollector) {
//        this.languageOrCollector = languageOrCollector;
//    }
//
//    /**
//     * @return the professionalAndCollector
//     */
//    public SearchProfessionalInfoRequerimentAndOperator getProfessionalAndCollector() {
//        return professionalAndCollector;
//    }
//
//    /**
//     * @param professionalAndCollector the professionalAndCollector to set
//     */
//    public void setProfessionalAndCollector(SearchProfessionalInfoRequerimentAndOperator professionalAndCollector) {
//        this.professionalAndCollector = professionalAndCollector;
//    }
//
//    /**
//     * @return the professionalOrCollector
//     */
//    public SearchProfessionalInfoRequerimentOrOperator getProfessionalOrCollector() {
//        return professionalOrCollector;
//    }
//
//    /**
//     * @param professionalOrCollector the professionalOrCollector to set
//     */
//    public void setProfessionalOrCollector(SearchProfessionalInfoRequerimentOrOperator professionalOrCollector) {
//        this.professionalOrCollector = professionalOrCollector;
//    }
//
//    /**
//     * @return the relocatingAndCollector
//     */
//    public SearchRelocatingInfoRequerimentAndOperator getRelocatingAndCollector() {
//        return relocatingAndCollector;
//    }
//
//    /**
//     * @param relocatingAndCollector the relocatingAndCollector to set
//     */
//    public void setRelocatingAndCollector(SearchRelocatingInfoRequerimentAndOperator relocatingAndCollector) {
//        this.relocatingAndCollector = relocatingAndCollector;
//    }
//
//    /**
//     * @return the relocatingOrCollector
//     */
//    public SearchRelocatingInfoRequerimentOrOperator getRelocatingOrCollector() {
//        return relocatingOrCollector;
//    }
//
//    /**
//     * @param relocatingOrCollector the relocatingOrCollector to set
//     */
//    public void setRelocatingOrCollector(SearchRelocatingInfoRequerimentOrOperator relocatingOrCollector) {
//        this.relocatingOrCollector = relocatingOrCollector;
//    }
//
//    /**
//     * @return the company
//     */
//    public Company getCompany() {
//        return company;
//    }
//
//    /**
//     * @param company the company to set
//     */
//    public void setCompany(Company company) {
//        this.company = company;
//    }
//
//    /**
//     * @return the previewCandidates
//     */
//    public List<Candidate> getPreviewCandidates() {
//        return previewCandidates;
//    }
//
//    /**
//     * @param previewCandidates the previewCandidates to set
//     */
//    public void setPreviewCandidates(List<Candidate> previewCandidates) {
//        this.previewCandidates = previewCandidates;
//    }
//    
//    public void onNewCompany(@Observes @CreatedEntityEvent Company c){
//        FacesContext context = FacesContext.getCurrentInstance();
//        HttpServletRequest request = (HttpServletRequest)context.getExternalContext().getRequest();
//        Locale locale=context.getViewRoot().getLocale();
//        ResourceBundle rb = ResourceBundle.getBundle("messages", locale);
//        String testSearch=rb.getString("TestSearch");
//        search.setDescription(testSearch);
//        search.setIsPublic(Boolean.FALSE);
//        search.setRequiredVehicle(Boolean.FALSE);
//        CompanyFolder folder=createFolder();
//        search.setCreateDate(new Date());
//        search.setLastSearchDate(new Date());
//        search.setCompany(c);
//        createAdvancedParametersAndPersist();
//        if(folder.getSearchList()==null){
//            folder.setSearchList(new ArrayList<Search>());
//        }
//        folder.getSearchList().add(search);
//        if(getCompany().getSearchList()==null){
//            getCompany().setSearchList(new ArrayList<Search>());
//        }
//        getCompany().getSearchList().add(search);
//        searchEJB.edit(search);
//        companyEJB.edit(c);
//        companyFolderEJB.edit(folder);
//        newSearchEvent.fire(search);
//    }
//
//    
//}
